package com.project.controller;

import com.project.bean.UserBean;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;

@RestController
@RequestMapping("room")
public class RoomController {
    @RequestMapping(value = "add",method = RequestMethod.POST)
    public String  addRoom(){
        return "添加房间";
    }

    @RequestMapping("/del/{id}")
    public String delRoom(@PathVariable("id") Integer roomId){
        return "删除房间"+roomId;
    }

    @RequestMapping("/find")
    public void find(HttpServletRequest req, HttpServletResponse resp) throws Exception{
        resp.getWriter().print("hello ,world");

    }

    @RequestMapping("getUser")
    public UserBean getUser(){
        return new UserBean(1,"张三","123",8000,"13293029384", LocalDate.parse("2000-02-03"));
    }
}
